home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
macdrivermuseum.net
/
www.macdrivermuseum.net.tar
/
www.macdrivermuseum.net
/
nic
/
cabletron.sit
/
Cabletron Ethertalk Installer
/
aux_dni
/
startup_cs.Z
/
startup_cs
Wrap
Text File
|
1992-01-12
|
3KB
|
134 lines
#!/bin/sh
#
# startup cs
#
# @(#)Copyright Apple Computer 1987-89
# Copyright Cabletron Systems 1989-90
# Version 0.0.1 of cs on 7/10/90
#
# This initializes the Cabletron cs DNI network interface.
#
PATH=/bin:/usr/bin:/etc:/usr/etc
ScriptName=$0
#
# main program
#
#
# parse the "-i" flag
#
if [ "$1" = "-i" ]; then
InstFlag=1
shift
else
InstFlag=0
fi
#
# check to see if an ethernet card is actually installed
#
#/etc/etheraddr > /dev/null
#status=$?
#if [ $status -ne 0 ]; then
# echo 'No Ethernet card(s) installed.'
# exit 0
#fi
if [ $InstFlag = 1 ]; then
sh /etc/sethost
fi
if [ -f /etc/HOSTNAME ]; then
read host domain < /etc/HOSTNAME
else
host=`/bin/hostname`
fi
#
# Get the network info for each cs board in the system
#
while [ $# != 0 ]; do
case $1 in
-C) (
maxdev=$2 # max number of devices (boards)
echo " $maxdev Ethernet card(s) installed"
unit=0
if [ ! -f /etc/NETADDRS ]; then
# get pertinent information and set up data base for first time
while [ "$unit" -lt "$maxdev" ]; do
while [ "$inetaddr" = "" ]; do
echo "cs$unit: Please enter an Internet address: \c"
read inetaddr
done
while [ "$broadcast" = "" ]; do
echo "cs$unit: Please enter an Internet Broadcast address: \c"
read broadcast
done
echo "cs$unit: Please enter a netmask [none]: \c"
read netmask
if [ "$netmask" = "none" ]; then
netmask=
fi
echo "cs$unit $inetaddr $broadcast $netmask" >> /etc/NETADDRS
echo "$inetaddr $host # `/bin/date`" >> /etc/hosts
unit=`expr $unit + 1`
inetaddr=; broadcast=;
done
fi
# go through /etc/NETADDRS data base, filling in info for new cards
# allow for possibility (though undesirable) of line containing only
# unit number
unit=0
while [ "$unit" -lt "$maxdev" ]; do
set ''`/bin/sed -n "/^[ ]*cs$unit/p" /etc/NETADDRS`
n=$#
inetaddr=$2; broadcast=$3; netmask=$4
while [ "$inetaddr" = "" ]; do
echo "cs$unit: Please enter an Internet address: \c"
read inetaddr
done
while [ "$broadcast" = "" ]; do
echo "cs$unit: Please enter an Internet Broadcast address: \c"
read broadcast
done
if [ "$n" -lt 2 ]; then
# first time for this card; ask for netmask
echo "cs$unit: Please enter a netmask [none]: \c"
read netmask
if [ "$netmask" = "none" ]; then
netmask=
fi
echo "cs$unit $inetaddr $broadcast $netmask" >> /etc/NETADDRS
echo "$inetaddr $host # `/bin/date`" >> /etc/hosts
fi
echo "cs$unit: hostname is $host with IP address of $inetaddr \c"
echo "broadcasting with $broadcast"
if [ $InstFlag = 0 ]; then
if [ -n "$netmask" ]; then
/etc/ifconfig cs$unit "$inetaddr" broadcast "$broadcast" netmask \
"$netmask" -trailers
else
/etc/ifconfig cs$unit "$inetaddr" broadcast "$broadcast" -trailers
fi
/etc/ifconfig cs$unit
fi
unit=`expr $unit + 1`
done
)
;;
-D) ;;
-S) ;;
*) echo "$ScriptName: unexpected argument: $1"
exit 1
;;
esac
shift 2
done